export const setItem = (key, data)=>{
	try {
		uni.setStorageSync(key, data);
	} catch (e) {
		// error
		console.log(e)
	}
}

export const setUserInfo = (data)=>{
	try {
		uni.setStorageSync("token", data.token);
		uni.setStorageSync("uid", data.id);
		uni.setStorageSync("username", data.username);
		uni.setStorageSync("avatar", data.avatar);
	} catch (e) {
		// error
		console.log(e)
	}
}



export const getItem = (key) => {
	try {
		const value = uni.getStorageSync(key);
		return value;
	} catch (e) {
		// error
		console.log(e)
	}
}

export const removeItem = (key) => {
	try {
		 uni.removeStorageSync(key);
	} catch (e) {
		// error
		console.log(e)
	}
}